import request from './index';

export const login = (data) => request.post('/user/login', data);
export const register = (data) => request.post('/user/register', data);
export const getProfile = () => request.get('/user/profile');
export const getAllUsers = () => request.get('/user/all');
export const checkPhone = (phone) => request.get('/user/check-phone', { params: { phone } });
export const checkUsername = (username) => request.get('/user/check-username', { params: { username } });
export const refreshToken = () => request.post('/user/login', {}, { headers: { Authorization: 'Bearer ' + localStorage.getItem('token') } }); 